//
//	ZcoModelConfirmData.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelConfirmData.h"

NSString *const kZcoModelConfirmDataAnswer = @"answer";
NSString *const kZcoModelConfirmDataData = @"data";
NSString *const kZcoModelConfirmDataType = @"type";

@interface ZcoModelConfirmData ()
@end
@implementation ZcoModelConfirmData




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelConfirmDataAnswer] isKindOfClass:[NSNull class]]){
		self.answer = dictionary[kZcoModelConfirmDataAnswer];
	}
    if(!self.answer){
        self.answer = @"ok";
    }
	if(![dictionary[kZcoModelConfirmDataData] isKindOfClass:[NSNull class]]){
		self.data = dictionary[kZcoModelConfirmDataData];
	}

	if(![dictionary[kZcoModelConfirmDataType] isKindOfClass:[NSNull class]]){
		self.type = dictionary[kZcoModelConfirmDataType];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.answer != nil){
		dictionary[kZcoModelConfirmDataAnswer] = self.answer;
	}
	if(self.data != nil){
		dictionary[kZcoModelConfirmDataData] = self.data;
	}
	if(self.type != nil){
		dictionary[kZcoModelConfirmDataType] = self.type;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.answer != nil){
		[aCoder encodeObject:self.answer forKey:kZcoModelConfirmDataAnswer];
	}
	if(self.data != nil){
		[aCoder encodeObject:self.data forKey:kZcoModelConfirmDataData];
	}
	if(self.type != nil){
		[aCoder encodeObject:self.type forKey:kZcoModelConfirmDataType];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.answer = [aDecoder decodeObjectForKey:kZcoModelConfirmDataAnswer];
	self.data = [aDecoder decodeObjectForKey:kZcoModelConfirmDataData];
	self.type = [aDecoder decodeObjectForKey:kZcoModelConfirmDataType];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelConfirmData *copy = [ZcoModelConfirmData new];

	copy.answer = [self.answer copy];
	copy.data = [self.data copy];
	copy.type = [self.type copy];

	return copy;
}

@end
